
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/shop_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>商品分类管理</strong> &gt;&gt;  添加商品分类
		</div>
		
		<div class="admin_right_info">
			<form action="/ychadmin/shop/add/" method="post" id="siteForm" name="siteForm">
			<div class="admin_right_info_title"><h2>添加商品分类</h2></div>
			<ul>
				<li>
					<font color="red"><?php echo @validation_errors(); ?></font>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">分类名称：</div>
					<div class="admin_right_info_tr admin_right_info_m">
					<input type="text" name="title" id="title" size="50"  value="<?php echo @set_value('title');?>" />
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="titleTip"></div> </div>
				</li>
				<li>
					<div class="admin_right_info_tr admin_right_info_l">上级分类：</div>
					<div class="admin_right_info_tr admin_right_info_m">
						<select  id="parent_id" name="parent_id">
							<option value="0">顶级分类</option>
							<?php foreach ($site_array as $val){  ?>
								<option value="<?php echo $val['id']?>" ><?php echo $val['title']?></option>
								<?php if(isset($val['category_list']) && is_array($val['category_list']) && count($val['category_list'])>0){
									foreach ($val['category_list'] as $v){
									?>
									<option value="<?php echo $v['id']?>" >----<?php echo $v['title']?></option>	
								<?php }}?>
							<?php }?>
						</select>
					</div>
					<div class="admin_right_info_tr admin_right_info_r"><div id="paret_id" style="color:red;">顶级分类则无父分类</div> </div>
				</li>
			</ul>
			<div class="admin_right_info_title" style="margin-top:20px;"><h2></h2></div>
			<ul><li>
					<input type="submit" value="提交" />
				</li></ul>
			</form>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"siteForm",debug:false,submitOnce:true,
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li>" + msg + "</li>")
			});
			alert(msg);
		},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#title").formValidator({autoModify:true,onShow:"",onFocus:"标题在1-50个汉字之间",onCorrect:""}).inputValidator({min:1,max:50,onError:"标题不能为空,请确认"});
//	$("#url").formValidator({autoModify:true,onShow:"",onFocus:"UEL在1-20个字符之间",onCorrect:""}).inputValidator({min:1,max:20,onError:"URL必须在1-20个字符之间,请确认"});
//	$("#forder").formValidator({autoModify:true,onShow:"",onFocus:"序号必须为数字",onCorrect:""}).inputValidator({min:0,max:99,type:"value",onErrorMin:"排序值必须为数字,请确认"});
});
function type_set_click(_this) {
	var typeid = $(_this).val();
	
	if(typeid == 0){
		$("#site_content").css("display","");
	}else{
		$("#site_content").css("display","none");
	}
	
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
